<?php


	class MainHelper {		
		
		//guide all page
		static function guide_pages(){
			return array('tutorial', 'unit', 'information', 'home', 'ceremony', 'market', 'guild', 'map', 'subjugation', 'expedition', 'colony', 'battle', 'important_matter', 'operation');
		}
		
		//guide menu center helper
		public static function gmch($get_page, $page, $menu_label){
			if($get_page == $page){
				return $menu_label;
			}else{
				return '<a href="guide.php?page='.$page.'">'.$menu_label.'</a>';
			}
		}
		
		//Lọc chuỗi
		function killchar($sInput)
		{
			$badChars = array("select", "drop", "--", "insert", "delete", "update", "xp_","script","*",".swf","=","or","'");
			$size=count($badChars);	
			for($i=0;$i<$size;$i++)	
				$sInput=str_replace($badChars[$i],"",$sInput);
			return $sInput;
		}
		
		function anti_sql($sql) {
	  	 $sql = str_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|*|--|\)/"),"",$sql);
		 $sql =trim(addslashes($sql)); #strtolower()
		 /* $sql = str_replace("'", "''", $sql);
		  $sql = str_replace("'", """", $sql);	 */
		return $sql;
}
		
	}
?>